<template>
  <div>
    <b v-for="v in count" :key="v"
      :class="activeCount>=v?'active': ''"
      @click="onChange(v)"
    >☆</b>
  </div>
</template>


<script>
export default {
  props: {
    count: {
      type: Number,
      default: 5
    },
    activeCount: {
      type: Number,
      default: 5
    }
  },
  methods: {
    onChange(v) {
      this.$emit('onChange', v)
    }
  }
}
</script>

<style scoped>
  b.active{
    color: red
  }
</style>